package com.github.grpc.server.utils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.core.io.ClassPathResource;

import java.io.File;
import java.io.IOException;

public class CertFileUtil {

    private static final Logger log = LoggerFactory.getLogger(CertFileUtil.class);

    public static File getFile(String path) {
        try {
            return new ClassPathResource(path).getFile();
        } catch (IOException e) {
            log.error("load file fail: {}", path, e);
            return null;
        }
    }

}
